package org.RSG.Interface;

import java.awt.*;
import javax.swing.*;

import org.RSG.Resources.Icons;

public class AppDesktop
{
	public JFrame window;
	public JDesktopPane desktop;
	public AppDesktop(int width, int height, String caption)
	{
		Icons icons = new Icons();
		this.window = new JFrame(caption);
		this.window.setPreferredSize(new Dimension(width, height));
		this.window.setIconImage(icons.GetIcon(0));
		
		this.desktop = new JDesktopPane();
		this.desktop.setBackground(new Color(128, 128, 128));
		
		this.window.add(this.desktop);
		this.window.pack();
		this.window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.window.setResizable(true);
		this.window.setVisible(true);
		//Correct Internal Size
		Insets insets = this.window.getInsets();
		this.window.setSize(new Dimension(this.window.getWidth() + insets.left + insets.right, this.window.getHeight() + insets.top + insets.bottom));
	}
}